package com.mayikt.controller;

import com.mayikt.utils.RedisTemplateUtils;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.GetMapping;

import javax.annotation.Resource;

@RestController
public class RedisController {
    @Resource
    private RedisTemplateUtils redisTemplateUtils;

    /**
     * 根据key获取redis的value
     * @param key
     * @return
     */
    @GetMapping("/redis/{key}")
    public Object redisValue(@PathVariable String key) {
        return redisTemplateUtils.getObject(key);
    }
}
